import service from "@/utils/request.js"

// 根据书名查找书籍
const search = (searchString: string, page?: number) : Promise => {
  return service.request({
    method: 'get',
    url: '/search',
    params: {
      val: searchString,
      page
    }
  })
}

// 根据输入获取有关书名
const getNames = (name: string) : Promise => {
  return service.request({
    method: 'get',
    url: '/getNames',
    params: {
      val: name
    }
  })
}

export {search, getNames}